package com.gzsxy.esjy.configuration.listener;


import com.gzsxy.esjy.netty.IBootStrapServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextClosedEvent;

/**
 * 程序关闭监听
 * @author zhangxiaolong
 * @date 2022/7/6 9:36
 */
public class ApplicationCloseListener implements ApplicationListener<ContextClosedEvent>{

	@Autowired
	private IBootStrapServer nettyServer ;
	
	@Override
	public void onApplicationEvent(ContextClosedEvent event) {
		nettyServer.close();
	}

}
